package 创建型设计模式.原型模式.demo;

/** 浅拷贝
 * @Author lf
 * @Date 3/29/2024
 */
public class ConcretePrototype implements Prototype{
    private String field;

    public ConcretePrototype(String field) {
        this.field = field;
    }

    // 浅拷贝
    @Override
    public Prototype clone() throws CloneNotSupportedException {
        return (Prototype) super.clone();
    }

    public String getField() {
        return field;
    }

    public void setField(String field) {
        this.field = field;
    }
}
